import { defHttp } from '/@/utils/http/axios';
import { ContentTypeEnum } from '/@/enums/httpEnum';

enum Api {
  getcarList = '/admin-api/system/companyCar/page',
  carBorrowList = '/admin-api/system/companyCarBorrow/page',
  getcarAdd = '/admin-api/system/companyCar/save',
  getcarEdit = '/admin-api/system/car/update',
  getcarDelete = '/admin-api/system/companyCar/delete',
}

/**
 * @description: 获用户
 */
export const carList = (params: any) => {
  return defHttp.get<any>({ url: Api.getcarList, params });
};
export const carBorrowList = (params: any) => {
  return defHttp.get<any>({ url: Api.carBorrowList, params });
};
export const addcar = (params: any) => {
  return defHttp.post<any>({ url: Api.getcarAdd, params });
};
export const editcar = (params: any) => {
  return defHttp.put<any>({ url: Api.getcarEdit, params });
};
export const deletecar = (params: any) => {
  return defHttp.delete<any>({
    url: Api.getcarDelete,
    params,
    headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
  });
};
